module.exports = app => {
  const { router, controller, middleware } = app;

  router.get('/user/get', middleware.permission(), controller.user.get);
  router.get('/user/page', middleware.permission(), controller.user.page);
  router.post('/user/insert', middleware.permission(), controller.user.insert);
  router.post('/user/update', middleware.permission(), controller.user.update);
  router.post('/user/role/update', middleware.permission(), controller.user.updateRole);
  router.post('/user/trash', middleware.permission(), controller.user.trash);

  router.post('/user/signin', controller.user.signin);

  router.post('/user/nickname/update', middleware.permission(), controller.user.updateNickname);
  router.post('/user/password/update', middleware.permission(), controller.user.updatePassword);
  router.get('/user/info', controller.user.info);

  router.get('/permission/select',controller.permission.select);

  router.post('/permission/batch', middleware.permission(), controller.permission.updateByIds);

  router.get('/role/get', middleware.permission(), controller.role.get);
  router.get('/role/select', middleware.permission(), controller.role.select);
  router.post('/role/insert', middleware.permission(), controller.role.insert);
  router.post('/role/update', middleware.permission(), controller.role.update);
  router.post('/role/trash', middleware.permission(), controller.role.trash);

  router.post('/role/permission/batch', middleware.permission(), controller.role.updateByIds);

  router.get('/product/get', middleware.permission(), controller.product.get);
  router.get('/product/page', middleware.permission(), controller.product.page);
  router.post('/product/insert', middleware.permission(), controller.product.insert);
  router.post('/product/update', middleware.permission(), controller.product.update);
  router.post('/product/trash', middleware.permission(), controller.product.trash);

  router.post('/img/upload', controller.img.upload);


  router.get('/brand/get', middleware.permission(), controller.brand.get);
  router.get('/brand/select', middleware.permission(), controller.brand.select);
  router.post('/brand/insert', middleware.permission(), controller.brand.insert);
  router.post('/brand/update', middleware.permission(), controller.brand.update);
  router.post('/brand/trash', middleware.permission(), controller.brand.trash);

  router.get('/cate/get', middleware.permission(), controller.cate.get);
  router.get('/cate/select', middleware.permission(), controller.cate.select);
  router.post('/cate/insert', middleware.permission(), controller.cate.insert);
  router.post('/cate/update', middleware.permission(), controller.cate.update);
  router.post('/cate/trash', middleware.permission(), controller.cate.trash);

  router.get('/data/sale', middleware.permission(), controller.data.sale);

};
